1. Technical Field
This invention relates to a module for supporting online diagnostics in a Linux operating system. More specifically, the module enables mapping of contiguous physical memory from kernel address space to a user level address space.
2. Description of the Prior Art
Conventional memory allocators return memory which is contiguous in the virtual address space but is not guaranteed to be contiguous in the physical address space. For example, the Linux operating system""s user level kernel memory allocator (malloc) does not allocate memory blocks which are guaranteed to be contiguous in the physical address space. Accordingly, memory allocated using conventional mechanisms are not guaranteed to be usable for online cache testing in the Linux operating system environment.
In prior art computer systems utilizing the Unix operating system, a special memory buffer is allocated during kernel initialization to allow online processor cache testing. The memory buffer is mapped from the kernel level to the user level program. The buffer accounts for the requirement of allocating memory returns that are contiguous in both the virtual address space and the physical address space. However, the prior art memory buffer requires modification of the kernel by allocating the memory buffer during kernel initialization. In addition, the prior art memory buffer allocated at initialization remains in the system even when it is not required. Accordingly, the prior art memory buffer for the Unix operating system is static and does not allow active allocation of memory on an as needed basis.
There is therefore a need for a module that will allow user level processes to generate memory access which can be used to test the hardware caches in a Linux operating system on an as needed basis. The module must return memory to the user level which is contiguous in both the virtual and physical address spaces. Accordingly, it is desirable to provide a module that allows online testing of hardware cache without changing the kernel of the operating system.
This invention comprises a module for supporting online cache diagnostics in a Linux operating system. The module is dynamically loadable from the user space.
A first aspect of the invention is a method for supporting memory diagnostics. A module is loaded to a kernel of the operating system. A block of contiguous memory is allocated. Contiguous memory is mapped from the kernel address space to the user process address space. Control of the physical memory displacement between accesses is controlled from the user level. The memory is contiguous in both physical and virtual address spaces.
A second aspect of the invention is a computer system which includes a module adapted to be dynamically loaded to a kernel of an operating system. The module includes a manager to allocate contiguous memory. The manager maps contiguous physical memory from a kernel address space to a user process address space. The memory is contiguous in both the physical and virtual address space. A user level program controls physical memory displacement between accesses.
A third aspect of the invention is an article comprising a computer-readable signal bearing medium. In the medium, the article includes a module adapted to be dynamically loaded to a kernel of an operating system for allocating a block of contiguous memory. The module includes a manager for mapping contiguous memory from a kernel address space to a user process address space. A user level program controls physical memory displacements between accesses.
Other features and advantages of this invention will become apparent from the following detailed description of the presently preferred embodiment of the invention, taken in conjunction with the accompanying drawings.